import time
import random
from mysqlIDB import MysqlDb
import pymysql

from httprunner import __version__

def getRandomSet(bits):
    num_set = [chr(i) for i in range(48,58)]
    # char_set = [chr(i) for i in range(97,123)]
    # total_set = char_set + num_set

    value_set = "".join(random.sample(num_set, bits))

    return value_set

def username():
    strings = getRandomSet(4)
    unity_username = "Hh"+strings
    #把用户名称写入unity_username.md文件中
    # w 只能操作写入  r 只能读取   a 向文件追加
    # w+ 可读可写   r+可读可写    a+可读可追加
    # wb+写入进制数据
    # w模式打开文件，如果而文件中有数据，再次写入内容，会把原来的覆盖掉
    file_username = open(r'unity_username.txt', mode='w')
    file_username.write(unity_username)
    return unity_username




mysqlDB = MysqlDb()

def get_realname_status():
    realname_status = mysqlDB.realname_status()
    return realname_status[0]

def get_httprunner_version():
    return __version__


def sum_two(m, n):
    return m + n


def sleep(n_secs):
    time.sleep(n_secs)


if __name__ == '__main__' :
    #print(username())
    print(get_realname_status())

